Pulmonary cystic and cavitary lesions caused by diverse etiologies are commonly encountered in chest imaging. The terms "cyst" and "cavity" are used to describe air-filled regions in the center of a nodule or consolidation of the lung. To date, only radiologic aspects of these lesions have been addressed. The morphologies of pulmonary cystic and cavitary lesions exhibit a broad spectrum, ranging from benign to malignant pulmonary diseases of acquired or congenital origin, including variable infectious diseases. In this review, we summarized the differential diagnosis of pathological entities to provide pathologists and radiologists with an overview of the diseases most commonly associated with pulmonary cystic and cavitary lesions in adults and children. The results showed slightly different patterns in the distribution of the diseases in the two groups. The most common causes of cavitary lesions include malignancy and infection in adults, and congenital malformation in children. Therefore, identification of pathologic entities correlating with the radiologic findings, clinical course, and location of the lesion is important in the evaluation of cystic and cavitary lung lesions in order to avoid unnecessary surgical procedures or delayed treatment.